package com.jiezuo.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description 同意/驳回
 * @author 庞留杰
 * @date 2023-1-9 13:58:18
 * @version V1.0
 **/
@Getter
@AllArgsConstructor
public enum AgreeEnum {

    驳回("0"),
    同意("1");

    private String state;

    public static AgreeEnum actionOf(String state) {
        for (AgreeEnum actionEnum : values()) {
            if (actionEnum.getState().equals(state.toLowerCase())) {
                return actionEnum;
            }
        }
        throw new RuntimeException("[类型]未找到对应的枚举");
    }

}
